import java.awt.Color;
import java.awt.Font;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Collections;
import java.util.Random;
import java.util.ArrayList; 

import ij.IJ;
import ij.ImagePlus;
import ij.gui.NewImage;
import ij.plugin.PlugIn;
import ij.process.ColorProcessor;
import ij.process.ImageProcessor;
import ij.process.ByteProcessor;

// On fournit deux images (meme taille), on fabrique un masque et les deux images transformees

public class cryptoDraw3 extends ImagePlus implements PlugIn{
	
	//private ImageProcessor primeIP; 

	private int X=1024,Y=768; // image size

	
	private ImagePlus maskAlpha;  
	private ImageProcessor maskAlphaIP;  

	
	private Random generator=new Random(1214); 
	
	public void run(String arg) {
		System.out.println("go");
		
		

 			ImagePlus laListe[]=new ImagePlus[25];
 			ImageProcessor lesProcs[]=new ImageProcessor[25]; 

 			

 			 File dir = new File("H:/Povray/carres32");
 			File[] list = dir.listFiles(); 
 		    for (int i=0;i<25;i++) {
 		    	System.out.println(i); 
 		    	laListe[i]=IJ.openImage(list[i].toString()) ; 
 		    	lesProcs[i]=laListe[i].getProcessor();
 		    }

 		  

	ImagePlus image1=NewImage.createRGBImage ("Image1",5*X,5*Y, 1, NewImage.FILL_WHITE);

	ImageProcessor i1=image1.getProcessor();

	for(int col=0;col<5;col++)
		for(int lig=0;lig<5;lig++)

				for(int i=0;i<X;i++){
						for(int j=0;j<Y;j++){

							i1.putPixel(1024*col+i,768*lig+ j, lesProcs[col+5*lig].getPixel(i,j)); 

		}// y
     }//x
	image1.show();
}
	

}